<?php


namespace App\Services\common;



use App\Models\User;

class SportLog
{
    /**
     * 初始化每日运动数据
     * @return bool
     */
    public static function initSportData()
    {
        $user = User::where('status',1)->pluck('id');
        $data = [];
        foreach ($user as $item){
            $data[] = [
                'user_id' => $item,
                'number' => 0,
                'created_at' => date("Y-m-d H:i:s")
            ];
        }
        \App\Models\user\SportLog::insert($data);
        return true;
    }
}